<?php echo $this->escape($this->status);?>
<br>
<table width="100%" cellpadding="0" cellspacing="0" border="1">
    <tr align="center" bgcolor="#800080">

    <td width="10"><font size="2" color='#FFFFFF' style='font-weight:500'>Remove</font></td>
    <td><font size="2" color='#FFFFFF' style='font-weight:500'>Image</font></td>
    <td><font size="2" color='#FFFFFF' style='font-weight:500'>Product name</font></td>
    <td><font size="2" color='#FFFFFF' style='font-weight:500'>Quantity</font></td>
    <td><font size="2" color='#FFFFFF' style='font-weight:500'>Unit price</font></td>
    <td><font size="2" color='#FFFFFF' style='font-weight:500'>Total price</font></td>
    </tr>

    <form action="<?php echo $this->url(array('controller'=>'order','action'=>'update')); ?>" method="POST">

    <?php
        $total = 0;
        if (isset($this->product) && isset($this->quantity))
        {
            foreach($this->product as $id=>$row)
            {
                $quantity = $this->quantity[$id];
                $price = $quantity*$row->price;
                $path = $this->baseUrl()."/images/product/".$row->url;
                $temp = 'text'.$row->id;
                echo "<tr>
                    <td align='center'><input type='checkbox' value ='1' name='$row->id'></td>
                    <td align='center'><img width='100' src='$path'> </td>
                    <td align='center'><font size='2'>$row->name<font size='2'></td>
                    <td align='center'><input type='text' size ='3' name=$temp value =$quantity></td>
                    <td align='center'><font size='2'>$row->price<font size='2'></td>
                    <td align='center'><font size='2'>$price</font></td>
                    </tr> ";
                $total += $price;
            }
            $productSession = new Zend_Session_Namespace('product');
            $productSession->total = $total;
        }
        echo " <tr>
                <td></td><td></td><td></td><td></td><td></td>
                <td align='center'>$total</td>
                </tr>";
    ?>
</table>
<br>

    <table width="100%" border="0">
    <tr>
        <td width="16%" valign="top">
            <input type="submit" style="background-color:#800080; color:#FFFFFF" value="Update">
            </form></td>
        <td align="center" valign="top">
            <form action="<?php echo $this->baseUrl();?>" method="POST">
                <input type="submit" style="background-color:#800080; color:#FFFFFF" value="Shopping">
            </form></td>
        <td width="35" align="right" valign="top">
            <form action="<?php echo $this->baseUrl();?>/user/order/">
                <input type="submit" style="background-color:#800080; color:#FFFFFF" value="Checkout">
            </form></td>
    </tr>
    </table>
    
<?php
    $productSession = new Zend_Session_Namespace('product');
    if (isset($productSession->mess)):
        echo "<br><font color='#800080'>".$productSession->mess."</font>";
    endif;
?>